decred / atomicswap

On-chain atomic swaps for Decred and other cryptocurrencies.
https://blog.decred.org/2017/09/20/On-Chain-Atomic-Swaps/
ISC License
508 stars 231 forks source link

Verify all getrawchangeaddress addresses are P2PKH. #68

Closed jrick closed 6 years ago

jrick commented 6 years ago

The code only checks that the address has a Hash160 method, which is true of both P2PKH and P2SH addresses. If the wallet being queried by any of these tools has added segwit support, and the optional parameter has not been added to request a "legacy" P2PKH address, the wallet may return a P2SH-witness address that will not be usable and may lead to unspendable/lost coins if a refund must be made.