Fixes for api changes
This commit is contained in:
parent
c85a3a29e3
commit
9cc6600db2
2 changed files with 2 additions and 25 deletions
14
createtx.go
14
createtx.go
|
@ -164,24 +164,12 @@ func (w *BtcWallet) txToPairs(pairs map[string]uint64, fee uint64, minconf int)
|
|||
msgtx.AddTxOut(txout)
|
||||
}
|
||||
|
||||
var netID byte
|
||||
switch w.Wallet.Net() {
|
||||
case btcwire.MainNet:
|
||||
netID = btcutil.MainNetAddr
|
||||
case btcwire.TestNet:
|
||||
fallthrough
|
||||
case btcwire.TestNet3:
|
||||
netID = btcutil.TestNetAddr
|
||||
default: // wrong!
|
||||
return nil, ErrUnknownBitcoinNet
|
||||
}
|
||||
|
||||
// Selected unspent outputs become new transaction's inputs.
|
||||
for _, op := range outputs {
|
||||
msgtx.AddTxIn(btcwire.NewTxIn((*btcwire.OutPoint)(&op.Out), nil))
|
||||
}
|
||||
for i, op := range outputs {
|
||||
addrstr, err := btcutil.EncodeAddress(op.Addr[:], netID)
|
||||
addrstr, err := btcutil.EncodeAddress(op.Addr[:], w.Wallet.Net())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
@ -1036,18 +1036,7 @@ func (a *btcAddress) changeEncryptionKey(oldkey, newkey []byte) error {
|
|||
// paymentAddress returns a human readable payment address string for
|
||||
// an address.
|
||||
func (a *btcAddress) paymentAddress(net btcwire.BitcoinNet) (string, error) {
|
||||
var netID byte
|
||||
switch net {
|
||||
case btcwire.MainNet:
|
||||
netID = btcutil.MainNetAddr
|
||||
case btcwire.TestNet:
|
||||
fallthrough
|
||||
case btcwire.TestNet3:
|
||||
netID = btcutil.TestNetAddr
|
||||
default: // wrong!
|
||||
return "", errors.New("unknown bitcoin network")
|
||||
}
|
||||
return btcutil.EncodeAddress(a.pubKeyHash[:], netID)
|
||||
return btcutil.EncodeAddress(a.pubKeyHash[:], net)
|
||||
}
|
||||
|
||||
func walletHash(b []byte) uint32 {
|
||||
|
|
Loading…
Add table
Reference in a new issue