bitcoind 0.17/0.18 getbalance compatibility change

Because of bitcoind deprecating its internal account system, the getbalance RPC call now has a dummy argument as the first argument. The help says it can be omitted or changed to '*', so we change it to '*', both for backward compatibility and because in testing I found that omitting the argument was broken. Using '*' has the same semantics as omitting the argument, if accounts were not used in the previous version of bitcoind.
This commit is contained in:
Michael Hampton 2019-07-30 17:33:30 -04:00 committed by Josh Harvey
parent 1a53ce5fa1
commit def5a16ad4

View file

@ -27,7 +27,7 @@ function checkCryptoCode (cryptoCode) {
function accountBalance (account, cryptoCode, confirmations) {
return checkCryptoCode(cryptoCode)
.then(() => fetch('getbalance', ['', confirmations]))
.then(() => fetch('getbalance', ['*', confirmations]))
.then(r => BN(r).shift(unitScale).round())
}