update best difficulty

This commit is contained in:
Ben
2023-07-02 19:44:41 -04:00
parent 0b07992365
commit 8d7dacf4b1
2 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -158,7 +158,7 @@ export class MiningJob {
const addressInfo = getAddressInfo(address); const addressInfo = getAddressInfo(address);
switch (addressInfo.type) { switch (addressInfo.type) {
case AddressType.p2wpkh: { case AddressType.p2wpkh: {
return bitcoinjs.payments.p2wpkh({ address, network: bitcoinjs.networks.testnet }).output; return bitcoinjs.payments.p2wpkh({ address }).output;
} }
case AddressType.p2pkh: { case AddressType.p2pkh: {
return bitcoinjs.payments.p2pkh({ address }).output; return bitcoinjs.payments.p2pkh({ address }).output;
+1 -1
View File
@@ -353,12 +353,12 @@ export class StratumV1Client extends EasyUnsubscribe {
'Duplicate share').response(); 'Duplicate share').response();
console.error(err); console.error(err);
await this.promiseSocket.write(err); await this.promiseSocket.write(err);
}
if (submissionDifficulty > this.entity.bestDifficulty) { if (submissionDifficulty > this.entity.bestDifficulty) {
await this.clientService.updateBestDifficulty(this.extraNonce, submissionDifficulty); await this.clientService.updateBestDifficulty(this.extraNonce, submissionDifficulty);
this.entity.bestDifficulty = submissionDifficulty; this.entity.bestDifficulty = submissionDifficulty;
} }
}
} else { } else {
const err = new StratumErrorMessage( const err = new StratumErrorMessage(