Fix parsing of amount commitments from prevtxs in signrawtransactionwithkey

This commit is contained in:
Glenn Willen 2020-09-02 12:23:28 -07:00 committed by Steven Roose
parent 4ae7d7abf1
commit 4e31616206
No known key found for this signature in database
GPG key ID: 2F2A88D7F8D68E87

View file

@ -956,8 +956,7 @@ UniValue SignTransaction(interfaces::Chain& chain, CMutableTransaction& mtx, con
newcoin.out.nValue = CConfidentialValue(AmountFromValue(find_value(prevOut, "amount")));
} else if (prevOut.exists("amountcommitment")) {
// Segwit sigs require the amount commitment to be sighashed
uint256 asset_commit = uint256S(prevOut["amountcommitment"].get_str());
newcoin.out.nValue.vchCommitment = std::vector<unsigned char>(asset_commit.begin(), asset_commit.end());
newcoin.out.nValue.vchCommitment = ParseHexO(prevOut, "amountcommitment");
}
newcoin.nHeight = 1;
view.AddCoin(out, std::move(newcoin), true);