OSDN Git Service
(root)
/
bytom
/
bytom.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7c788b4
)
add rescan-blocks api (#1055)
author
Derek
<shanhu5739@gmail.com>
Thu, 14 Jun 2018 11:52:14 +0000
(19:52 +0800)
committer
Paladz
<yzhu101@uottawa.ca>
Thu, 14 Jun 2018 11:52:14 +0000
(19:52 +0800)
* add rescan-blocks api
* rename rescan-blocks to rescan-wallet
* rename rescanWallet to rescanWallet
api/api.go
patch
|
blob
|
history
api/wallet.go
patch
|
blob
|
history
diff --git
a/api/api.go
b/api/api.go
index
56f756c
..
4c0beda
100644
(file)
--- a/
api/api.go
+++ b/
api/api.go
@@
-224,6
+224,7
@@
func (a *API) buildHandler() {
m.Handle("/backup-wallet", jsonHandler(a.backupWalletImage))
m.Handle("/restore-wallet", jsonHandler(a.restoreWalletImage))
+ m.Handle("/rescan-wallet", jsonHandler(a.rescanWallet))
} else {
log.Warn("Please enable wallet")
}
diff --git
a/api/wallet.go
b/api/wallet.go
index
d249401
..
e002c60
100644
(file)
--- a/
api/wallet.go
+++ b/
api/wallet.go
@@
-56,3
+56,8
@@
func (a *API) backupWalletImage() Response {
}
return NewSuccessResponse(image)
}
+
+func (a *API) rescanWallet() Response {
+ a.wallet.RescanBlocks()
+ return NewSuccessResponse(nil)
+}