mirror of
https://github.com/LBRYFoundation/lbcwallet.git
synced 2025-08-23 17:47:29 +00:00
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)
|
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.
|
// Selected unspent outputs become new transaction's inputs.
|
||||||
for _, op := range outputs {
|
for _, op := range outputs {
|
||||||
msgtx.AddTxIn(btcwire.NewTxIn((*btcwire.OutPoint)(&op.Out), nil))
|
msgtx.AddTxIn(btcwire.NewTxIn((*btcwire.OutPoint)(&op.Out), nil))
|
||||||
}
|
}
|
||||||
for i, op := range outputs {
|
for i, op := range outputs {
|
||||||
addrstr, err := btcutil.EncodeAddress(op.Addr[:], netID)
|
addrstr, err := btcutil.EncodeAddress(op.Addr[:], w.Wallet.Net())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
|
@ -1036,18 +1036,7 @@ func (a *btcAddress) changeEncryptionKey(oldkey, newkey []byte) error {
|
||||||
// paymentAddress returns a human readable payment address string for
|
// paymentAddress returns a human readable payment address string for
|
||||||
// an address.
|
// an address.
|
||||||
func (a *btcAddress) paymentAddress(net btcwire.BitcoinNet) (string, error) {
|
func (a *btcAddress) paymentAddress(net btcwire.BitcoinNet) (string, error) {
|
||||||
var netID byte
|
return btcutil.EncodeAddress(a.pubKeyHash[:], net)
|
||||||
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)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func walletHash(b []byte) uint32 {
|
func walletHash(b []byte) uint32 {
|
||||||
|
|
Loading…
Add table
Reference in a new issue