Fix broken sendmany RPC
The sendmany RPC was broken in the 3.3.0 release due to a bad merge of upstream KMD code,
resulting in this kind of error:
./src/hush-cli sendmany "" "{\"$TADDR1\": 0.0001, \"$TADDR2\": 0.0002, \"$TADDR3\": 0.0004}"
error code: -3
error message:
Amount is not a number or string
No matter how many recipients you give, it will always "fall off the end" of the array, because it increments i twice per loop.
That means AmountFromValue(sendTo[i]) is given an invalid amount and the RPC errors out, with no loss of funds.
This is not a consensus bug and only nodes who want to use the sendmany RPC need to upgrade.
Since GUI wallets do not use this RPC, it's most likely pools and exchanges that would want this.
This commit is contained in:
@@ -1529,7 +1529,6 @@ UniValue sendmany(const UniValue& params, bool fHelp, const CPubKey& mypk)
|
|||||||
|
|
||||||
CRecipient recipient = {scriptPubKey, nAmount, fSubtractFeeFromAmount};
|
CRecipient recipient = {scriptPubKey, nAmount, fSubtractFeeFromAmount};
|
||||||
vecSend.push_back(recipient);
|
vecSend.push_back(recipient);
|
||||||
i++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
EnsureWalletIsUnlocked();
|
EnsureWalletIsUnlocked();
|
||||||
|
|||||||
Reference in New Issue
Block a user