diff options
author | Peter Todd <pete@petertodd.org> | 2014-03-10 22:43:15 -0400 |
---|---|---|
committer | Peter Todd <pete@petertodd.org> | 2014-05-08 00:55:01 -0400 |
commit | 787ee0c91394b0ae16ca2500dbacf9349e65b6bc (patch) | |
tree | fddc4dec2f7085610253eb4f521149bc9b95653f /src/rpcwallet.cpp | |
parent | 4d79098ad548874ca6e4c09d873fc2f481e6edb4 (diff) |
Check redeemScript size does not exceed 520 byte limit
redeemScripts >520bytes can't be spent due to the
MAX_SCRIPT_ELEMENT_SIZE limit; previously the addmultisigaddress and
createmultisig RPC calls would let you violate that limit unknowingly.
Also made the wallet code itself check the redeemScript prior to adding
it to the wallet, which in the (rare) instance that a user has added an
invalid oversized redeemScript to their wallet causes an error on
startup. The affected key isn't added to the wallet; other keys are
unaffected.
Diffstat (limited to 'src/rpcwallet.cpp')
-rw-r--r-- | src/rpcwallet.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp index a5a7df0867..e21881dbe9 100644 --- a/src/rpcwallet.cpp +++ b/src/rpcwallet.cpp @@ -871,7 +871,7 @@ Value sendmany(const Array& params, bool fHelp) } // Defined in rpcmisc.cpp -extern CScript _createmultisig(const Array& params); +extern CScript _createmultisig_redeemScript(const Array& params); Value addmultisigaddress(const Array& params, bool fHelp) { @@ -908,7 +908,7 @@ Value addmultisigaddress(const Array& params, bool fHelp) strAccount = AccountFromValue(params[2]); // Construct using pay-to-script-hash: - CScript inner = _createmultisig(params); + CScript inner = _createmultisig_redeemScript(params); CScriptID innerID = inner.GetID(); pwalletMain->AddCScript(inner); |