txscript: Require SHA256 secret hashes for atomic swaps
This commit is contained in:
parent
8cea3866d0
commit
2e60448ffc
1 changed files with 3 additions and 3 deletions
|
@ -628,7 +628,7 @@ func ExtractPkScriptAddrs(pkScript []byte, chainParams *chaincfg.Params) (Script
|
||||||
type AtomicSwapDataPushes struct {
|
type AtomicSwapDataPushes struct {
|
||||||
RecipientHash160 [20]byte
|
RecipientHash160 [20]byte
|
||||||
RefundHash160 [20]byte
|
RefundHash160 [20]byte
|
||||||
SecretHash [20]byte
|
SecretHash [32]byte
|
||||||
LockTime int64
|
LockTime int64
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -653,8 +653,8 @@ func ExtractAtomicSwapDataPushes(pkScript []byte) (*AtomicSwapDataPushes, error)
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
isAtomicSwap := pops[0].opcode.value == OP_IF &&
|
isAtomicSwap := pops[0].opcode.value == OP_IF &&
|
||||||
pops[1].opcode.value == OP_RIPEMD160 &&
|
pops[1].opcode.value == OP_SHA256 &&
|
||||||
pops[2].opcode.value == OP_DATA_20 &&
|
pops[2].opcode.value == OP_DATA_32 &&
|
||||||
pops[3].opcode.value == OP_EQUALVERIFY &&
|
pops[3].opcode.value == OP_EQUALVERIFY &&
|
||||||
pops[4].opcode.value == OP_DUP &&
|
pops[4].opcode.value == OP_DUP &&
|
||||||
pops[5].opcode.value == OP_HASH160 &&
|
pops[5].opcode.value == OP_HASH160 &&
|
||||||
|
|
Loading…
Reference in a new issue