Partly add amount output

605e8473a7 (diff-1dbee12e01d094e7366545ec024c5041)
This commit is contained in:
lateminer
2018-10-29 21:38:53 +03:00
parent 19820c1f9f
commit 414b8b267d
4 changed files with 26 additions and 7 deletions

View File

@@ -608,6 +608,7 @@ UniValue signrawtransaction(const UniValue& params, bool fHelp)
" \"vout\":n, (numeric, required) The output number\n"
" \"scriptPubKey\": \"hex\", (string, required) script key\n"
" \"redeemScript\": \"hex\" (string, required for P2SH) redeem script\n"
" \"amount\": value (numeric, required) The amount spent\n"
" }\n"
" ,...\n"
" ]\n"
@@ -750,7 +751,10 @@ UniValue signrawtransaction(const UniValue& params, bool fHelp)
if ((unsigned int)nOut >= coins->vout.size())
coins->vout.resize(nOut+1);
coins->vout[nOut].scriptPubKey = scriptPubKey;
coins->vout[nOut].nValue = 0; // we don't know the actual output value
coins->vout[nOut].nValue = 0;
if (prevOut.exists("amount")) {
coins->vout[nOut].nValue = AmountFromValue(find_value(prevOut, "amount"));
}
}
// if redeemScript given and not using the local wallet (private keys