Skip to content

Commit 16951f5

Browse files
committed
signet/miner: drop do_createpsbt function
1 parent 3aed0a4 commit 16951f5

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

contrib/signet/miner

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -72,17 +72,6 @@ def signet_txs(block, challenge):
7272

7373
return spend, to_spend
7474

75-
def do_createpsbt(block, signme, spendme):
76-
psbt = PSBT()
77-
psbt.g = PSBTMap( {PSBT_GLOBAL_UNSIGNED_TX: signme.serialize(),
78-
PSBT_SIGNET_BLOCK: block.serialize()
79-
} )
80-
psbt.i = [ PSBTMap( {PSBT_IN_NON_WITNESS_UTXO: spendme.serialize(),
81-
PSBT_IN_SIGHASH_TYPE: bytes([1,0,0,0])})
82-
]
83-
psbt.o = [ PSBTMap() ]
84-
return psbt.to_base64()
85-
8675
def do_decode_psbt(b64psbt):
8776
psbt = PSBT.from_base64(b64psbt)
8877

@@ -137,7 +126,15 @@ def generate_psbt(tmpl, reward_spk, *, blocktime=None):
137126

138127
signme, spendme = signet_txs(block, signet_spk_bin)
139128

140-
return do_createpsbt(block, signme, spendme)
129+
psbt = PSBT()
130+
psbt.g = PSBTMap( {PSBT_GLOBAL_UNSIGNED_TX: signme.serialize(),
131+
PSBT_SIGNET_BLOCK: block.serialize()
132+
} )
133+
psbt.i = [ PSBTMap( {PSBT_IN_NON_WITNESS_UTXO: spendme.serialize(),
134+
PSBT_IN_SIGHASH_TYPE: bytes([1,0,0,0])})
135+
]
136+
psbt.o = [ PSBTMap() ]
137+
return psbt.to_base64()
141138

142139
def get_reward_addr_spk(args, height):
143140
assert args.address is not None or args.descriptor is not None

0 commit comments

Comments
 (0)