Teach signrawtransaction RPC about SIGHASH_FORKID
This commit is contained in:
parent
6b6abb3d12
commit
35844a3e01
|
@ -804,16 +804,22 @@ UniValue signrawtransaction(const UniValue& params, bool fHelp)
|
|||
const CKeyStore& keystore = tempKeystore;
|
||||
#endif
|
||||
|
||||
int nHashType = SIGHASH_ALL;
|
||||
int nHashType = SIGHASH_ALL | SIGHASH_FORKID;
|
||||
if (params.size() > 3 && !params[3].isNull()) {
|
||||
static map<string, int> mapSigHashValues =
|
||||
boost::assign::map_list_of
|
||||
(string("ALL"), int(SIGHASH_ALL))
|
||||
(string("ALL|SIGHASH_FORKID"), int(SIGHASH_ALL|SIGHASH_FORKID))
|
||||
(string("ALL|SIGHASH_FORKID|ANYONECANPAY"), int(SIGHASH_ALL|SIGHASH_FORKID))
|
||||
(string("ALL|ANYONECANPAY"), int(SIGHASH_ALL|SIGHASH_ANYONECANPAY))
|
||||
(string("NONE"), int(SIGHASH_NONE))
|
||||
(string("NONE|SIGHASH_FORKID"), int(SIGHASH_NONE|SIGHASH_FORKID))
|
||||
(string("NONE|SIGHASH_FORKID|ANYONECANPAY"), int(SIGHASH_NONE|SIGHASH_FORKID|SIGHASH_ANYONECANPAY))
|
||||
(string("NONE|ANYONECANPAY"), int(SIGHASH_NONE|SIGHASH_ANYONECANPAY))
|
||||
(string("SINGLE"), int(SIGHASH_SINGLE))
|
||||
(string("SINGLE|ANYONECANPAY"), int(SIGHASH_SINGLE|SIGHASH_ANYONECANPAY))
|
||||
(string("SINGLE|SIGHASH_FORKID"), int(SIGHASH_SINGLE|SIGHASH_FORKID))
|
||||
(string("SINGLE|SIGHASH_FORKID|ANYONECANPAY"), int(SIGHASH_SINGLE|SIGHASH_FORKID|SIGHASH_ANYONECANPAY))
|
||||
;
|
||||
string strHashType = params[3].get_str();
|
||||
if (mapSigHashValues.count(strHashType))
|
||||
|
|
Loading…
Reference in New Issue