1
0
mirror of https://github.com/bitcoinbook/bitcoinbook synced 2024-11-22 08:08:11 +00:00

Handle error when decoding address

This commit is contained in:
Michalis Kargakis 2014-07-26 15:58:56 +03:00
parent 38b4ec8ffa
commit 004c015db2

View File

@ -28,6 +28,7 @@ func PayToAddrScript(addressStr string) {
// the address type. It is also required for the upcoming call to
// PayToAddrScript.
address, err := btcutil.DecodeAddress(addressStr, &btcnet.MainNetParams)
handle(err)
// Create a public key script that pays to the address.
script, err := btcscript.PayToAddrScript(address)