mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-25 13:12:11 +02:00
lnwallet: import tadge's p2shify func
This commit is contained in:
@@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user