Permalink
Browse files

Add redeemScript to listunspent

  • Loading branch information...
Tranz5 committed Jul 19, 2014
1 parent c6ba27f commit e14dc292026611439c24915c530b0e57dd6a0e1c
Showing with 12 additions and 1 deletion.
  1. +12 −1 src/rpcrawtransaction.cpp
@@ -202,6 +202,17 @@ Value listunspent(CWallet* pWallet, const Array& params, bool fHelp)
entry.push_back(Pair("account", pWallet->mapAddressBook[address]));
}
entry.push_back(Pair("scriptPubKey", HexStr(pk.begin(), pk.end())));
if (pk.IsPayToScriptHash())
{
CTxDestination address;
if (ExtractDestination(pk, address))
{
const CScriptID& hash = boost::get<const CScriptID&>(address);
CScript redeemScript;
if (pWallet->GetCScript(hash, redeemScript))
entry.push_back(Pair("redeemScript", HexStr(redeemScript.begin(), redeemScript.end())));
}
}
entry.push_back(Pair("amount",ValueFromAmount(nValue)));
entry.push_back(Pair("confirmations",out.nDepth));
results.push_back(entry);
@@ -304,7 +315,7 @@ Value signrawtransaction(CWallet* pWallet, const Array& params, bool fHelp)
{
if (fHelp || params.size() < 1 || params.size() > 4)
throw runtime_error(
"signrawtransaction <hex string> [{\"txid\":txid,\"vout\":n,\"scriptPubKey\":hex},...] [<privatekey1>,...] [sighashtype=\"ALL\"]\n"
"signrawtransaction <hex string> [{\"txid\":txid,\"vout\":n,\"scriptPubKey\":hex,\"redeemScript\":hex},...] [<privatekey1>,...] [sighashtype=\"ALL\"]\n"
"Sign inputs for raw transaction (serialized, hex-encoded).\n"
"Second optional argument (may be null) is an array of previous transaction outputs that\n"
"this transaction depends on but may not yet be in the blockchain.\n"

0 comments on commit e14dc29

Please sign in to comment.