Skip to content

Commit

Permalink
修改 listsinceblock
Browse files Browse the repository at this point in the history
  • Loading branch information
bigzhu committed Jan 22, 2018
1 parent e7b4229 commit 291d65c
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions bitcoind.go
Original file line number Diff line number Diff line change
Expand Up @@ -534,20 +534,24 @@ func (b *Bitcoind) ListReceivedByAddress(minConf uint32, includeEmpty bool) (lis
return
}

// ListSinceBlock
func (b *Bitcoind) ListSinceBlock(blockHash string, targetConfirmations uint32) (transaction []Transaction, err error) {
r, err := b.client.call("listsinceblock", []interface{}{blockHash, targetConfirmations})
type ts struct {
Transactions []Transaction
LastBlock string
}

// ListSinceBlock kao
// modify by bigzhu
func (b *Bitcoind) ListSinceBlock(blockHash string, targetConfirmations uint32, includeWatchonly bool) (result ts, err error) {
r, err := b.client.call("listsinceblock", []interface{}{blockHash, targetConfirmations, includeWatchonly})
if err = handleError(err, &r); err != nil {
return
}
type ts struct {
Transactions []Transaction
}
var result ts

// var result ts
if err = json.Unmarshal(r.Result, &result); err != nil {
return
}
transaction = result.Transactions
// transaction = result.Transactions
return
}

Expand Down

0 comments on commit 291d65c

Please sign in to comment.