HomePhabricator

Fix CScriptID(const CScript& in) in empty script case
d78f0dafd520Unpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

Fix CScriptID(const CScript& in) in empty script case

Previously an empty script wouldn't be hashed, and CScriptID would be
assigned the incorrect value of 0 instead. This bug can be seen in the
RPC decodescript command:

$ btc decodescript ""
{
    "asm" : "",
    "type" : "nonstandard",
    "p2sh" : "31h1vYVSYuKP6AhS86fbRdMw9XHieotbST"
}

Correct output:

$ btc decodescript ""
{
    "asm" : "",
    "type" : "nonstandard",
    "p2sh" : "3J98t1WpEZ73CNmQviecrnyiWrnqRhWNLy"
}

Details

Provenance
Peter Todd <pete@petertodd.org>Authored on Dec 25 2014, 08:12
schancelPushed on Jan 5 2018, 21:58
schancelPushed on Jan 5 2018, 21:39
schancelPushed on Jan 5 2018, 21:17
Parents
rSTAGING4312c8fc1892: Merge pull request #5512
Branches
Unknown
Tags
Unknown

Event Timeline

Peter Todd <pete@petertodd.org> committed rSTAGINGd78f0dafd520: Fix CScriptID(const CScript& in) in empty script case (authored by Peter Todd <pete@petertodd.org>).Dec 25 2014, 08:18