Save pkScript of outpoint for txs to a watched address.
This commit is contained in:
parent
42b15ccaa3
commit
402764e132
1 changed files with 7 additions and 0 deletions
7
cmd.go
7
cmd.go
|
@ -410,6 +410,12 @@ func (w *BtcWallet) newBlockTxHandler(result interface{}, e *btcjson.Error) bool
|
||||||
log.Error("Tx Handler: Unspecified amount.")
|
log.Error("Tx Handler: Unspecified amount.")
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
pkscript58, ok := v["pkscript"].(string)
|
||||||
|
if !ok {
|
||||||
|
log.Error("Tx Handler: Unspecified pubkey script.")
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
pkscript := btcutil.Base58Decode(pkscript58)
|
||||||
spent, ok := v["spent"].(bool)
|
spent, ok := v["spent"].(bool)
|
||||||
if !ok {
|
if !ok {
|
||||||
log.Error("Tx Handler: Unspecified spent field.")
|
log.Error("Tx Handler: Unspecified spent field.")
|
||||||
|
@ -459,6 +465,7 @@ func (w *BtcWallet) newBlockTxHandler(result interface{}, e *btcjson.Error) bool
|
||||||
u := &tx.Utxo{
|
u := &tx.Utxo{
|
||||||
Amt: uint64(amt),
|
Amt: uint64(amt),
|
||||||
Height: int64(height),
|
Height: int64(height),
|
||||||
|
Subscript: pkscript,
|
||||||
}
|
}
|
||||||
copy(u.Out.Hash[:], txhash[:])
|
copy(u.Out.Hash[:], txhash[:])
|
||||||
u.Out.Index = uint32(index)
|
u.Out.Index = uint32(index)
|
||||||
|
|
Loading…
Reference in a new issue