Skip to content

Commit

Permalink
Don't pass second param to loadWallet
Browse files Browse the repository at this point in the history
This second boolean parameter causes an error on error on Bitcoin Core v0.20.1 and v25.0. It is not a documented parameter in v25 and newer versions of Bitcoin Core.

This parameter, in some versions of bitcoin, was supposed to cause a wallet to be automatically loaded, but this is unnecessary as sidetree makes a loadwallet call anyway.
  • Loading branch information
sangaman authored Jul 20, 2023
1 parent bf1f7ae commit d1bc2a2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/bitcoin/BitcoinClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ export default class BitcoinClient {
private async loadWallet () {
const request = {
method: 'loadwallet',
params: [this.walletNameToUse, true] // the wallet name
params: [this.walletNameToUse] // the wallet name
};

// Intentionally not throwing because bitcoin returns 500 when a wallet is already loaded
Expand Down
2 changes: 1 addition & 1 deletion tests/bitcoin/BitcoinClient.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ describe('BitcoinClient', async () => {
await bitcoinClient['loadWallet']();
expect(rpcSpy).toHaveBeenCalledWith({
method: 'loadwallet',
params: ['sidetreeDefaultWallet', true]
params: ['sidetreeDefaultWallet']
}, true, false);
expect(loggerSpy).toHaveBeenCalledWith(`Wallet loaded with name "sidetreeDefaultWallet".`);
});
Expand Down

0 comments on commit d1bc2a2

Please sign in to comment.