Send additional block information with a TxMinedNtfn.
This commit is contained in:
parent
497f177044
commit
dd3c9b2b5f
1 changed files with 15 additions and 3 deletions
|
@ -193,7 +193,11 @@ func (n *BlockDisconnectedNtfn) UnmarshalJSON(b []byte) error {
|
|||
// TxMinedNtfn is a type handling custom marshaling and
|
||||
// unmarshaling of txmined JSON websocket notifications.
|
||||
type TxMinedNtfn struct {
|
||||
Hash string `json:"hash"`
|
||||
TxID string `json:"txid"`
|
||||
BlockHash string `json:"blockhash"`
|
||||
BlockHeight int32 `json:"blockheight"`
|
||||
BlockTime int64 `json:"blocktime"`
|
||||
Index int `json:"index"`
|
||||
}
|
||||
|
||||
type txMinedResult TxMinedNtfn
|
||||
|
@ -202,8 +206,16 @@ type txMinedResult TxMinedNtfn
|
|||
var _ Notification = &TxMinedNtfn{}
|
||||
|
||||
// NewTxMinedNtfn creates a new TxMinedNtfn.
|
||||
func NewTxMinedNtfn(hash string) *TxMinedNtfn {
|
||||
return &TxMinedNtfn{Hash: hash}
|
||||
func NewTxMinedNtfn(txid, blockhash string, blockheight int32,
|
||||
blocktime int64, index int) *TxMinedNtfn {
|
||||
|
||||
return &TxMinedNtfn{
|
||||
TxID: txid,
|
||||
BlockHash: blockhash,
|
||||
BlockHeight: blockheight,
|
||||
BlockTime: blocktime,
|
||||
Index: index,
|
||||
}
|
||||
}
|
||||
|
||||
// Id satisifies the Notification interface by returning the id of the
|
||||
|
|
Loading…
Add table
Reference in a new issue