script/address: fix addr checking for nested p2sh inputs.
This commit is contained in:
parent
2054524fd7
commit
03ddc79dfc
@ -210,20 +210,24 @@ class Input {
|
|||||||
if (coin)
|
if (coin)
|
||||||
return coin.getAddress();
|
return coin.getAddress();
|
||||||
|
|
||||||
|
if (this.script.code.length > 0)
|
||||||
|
return this.script.getInputAddress();
|
||||||
|
|
||||||
if (this.witness.items.length > 0)
|
if (this.witness.items.length > 0)
|
||||||
return this.witness.getInputAddress();
|
return this.witness.getInputAddress();
|
||||||
|
|
||||||
return this.script.getInputAddress();
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the address hash.
|
* Get the address hash.
|
||||||
|
* @param {Coin?} coin
|
||||||
* @param {String?} enc
|
* @param {String?} enc
|
||||||
* @returns {Hash} hash
|
* @returns {Hash} hash
|
||||||
*/
|
*/
|
||||||
|
|
||||||
getHash(enc) {
|
getHash(coin, enc) {
|
||||||
const addr = this.getAddress();
|
const addr = this.getAddress(coin);
|
||||||
|
|
||||||
if (!addr)
|
if (!addr)
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@ -2337,7 +2337,7 @@ class Script {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
isScripthashInput() {
|
isScripthashInput() {
|
||||||
if (this.code.length < 2)
|
if (this.code.length < 1)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Grab the raw redeem script.
|
// Grab the raw redeem script.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user