Skip to content

Commit

Permalink
catch multisig deser throw
Browse files Browse the repository at this point in the history
  • Loading branch information
goatpig committed Sep 8, 2021
1 parent 7444410 commit a6b6069
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion cppForSwig/BtcUtils.h
Expand Up @@ -1190,7 +1190,17 @@ class BtcUtils
if( nextSz != 0x41 && nextSz != 0x21 )
return 0;

pkList[i] = brr.get_BinaryDataRef(nextSz);
try
{
pkList[i] = brr.get_BinaryDataRef(nextSz);
}
catch (const std::exception& e)
{
LOGERR << "Failed to decode pub keys for multisig script," <<
" with error: " << e.what();
LOGERR << script.toHexStr();
return 0;
}
}

return M;
Expand Down

0 comments on commit a6b6069

Please sign in to comment.