lnwallet: import tadge's p2shify func

This commit is contained in:
Olaoluwa Osuntokun 2015-12-16 22:55:52 -06:00
parent e2c4ccbe28
commit ddb74258ff

@ -14,6 +14,14 @@ type LightningChannel struct {
wallet *LightningWallet
channelEvents *chainntnfs.ChainNotifier
// P2SHify...
func P2SHify(scriptBytes []byte) ([]byte, error) {
bldr := txscript.NewScriptBuilder()
bldr.AddOp(txscript.OP_HASH160)
bldr.AddData(btcutil.Hash160(scriptBytes))
bldr.AddOp(txscript.OP_EQUAL)
return bldr.Script()
}
sync.RWMutex