File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -9,18 +9,20 @@ class P2PKHLockBuilder extends LockingScriptBuilder {
9
9
10
10
Address ? address;
11
11
List <int >? pubkeyHash;
12
+ NetworkType ? networkType;
12
13
13
14
P2PKHLockBuilder .fromAddress (Address address){
14
15
this .address = address;
16
+ this .networkType = address.networkType;
15
17
pubkeyHash = HEX .decode (address.pubkeyHash160);
16
18
}
17
19
18
- P2PKHLockBuilder .fromPublicKey (SVPublicKey publicKey, {NetworkType networkType = NetworkType .MAIN }){
19
- this .address = publicKey.toAddress (networkType);
20
+ P2PKHLockBuilder .fromPublicKey (SVPublicKey publicKey, {this . networkType = NetworkType .MAIN }){
21
+ this .address = publicKey.toAddress (networkType ?? NetworkType . MAIN );
20
22
pubkeyHash = HEX .decode (address! .pubkeyHash160);
21
23
}
22
24
23
- P2PKHLockBuilder .fromScript (SVScript script) : super .fromScript (script);
25
+ P2PKHLockBuilder .fromScript (SVScript script, { this .networkType = NetworkType . MAIN } ) : super .fromScript (script);
24
26
25
27
@override
26
28
SVScript getScriptPubkey () {
@@ -60,6 +62,7 @@ class P2PKHLockBuilder extends LockingScriptBuilder {
60
62
}
61
63
62
64
pubkeyHash = chunkList[2 ].buf;
65
+ address = Address .fromPubkeyHash (HEX .encode (pubkeyHash ?? []), networkType ?? NetworkType .MAIN );
63
66
}
64
67
}
65
68
You can’t perform that action at this time.
0 commit comments