-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature UTXO handler #57
base: master
Are you sure you want to change the base?
Conversation
def header(data) | ||
end | ||
|
||
def merkleblock(data) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There doesn't seem to be any implementation, is this one left empty?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I add implementation for merkleblock and header message.
When merkleblock is called, spv nodes will store the tx position data into the leveldb.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the correctness of the merkleblock
needs to be checked by restoring the markle tree.
* Delete key prefix 'h', 'b' because it is not used now.
def header(data) | ||
end | ||
|
||
def merkleblock(data) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the correctness of the merkleblock
needs to be checked by restoring the markle tree.
# - Delete from utxo_db for spent output. | ||
def tx(data) | ||
tx = data.tx | ||
tx.outputs.each_with_index do |output, index| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't you need to check if it is a Tx that exists in the merkleblock
that you received earlier?
Co-authored-by: shigeyuki azuchi <azuchi@chaintope.com>
Co-authored-by: shigeyuki azuchi <azuchi@chaintope.com>
This PR adds UTXO handler to save UTXOs and delete UTXOs from the database.
As described in README.md, SPV node start to collect UTXOs associated with wallet when utxo handler is initialized.
Note that
merkleblock
message in order to save the position of tx in the block but this PR does not contain it.Block height of UTXO is useful when we need to know UTXO is confirmed deeply (e.g. 6 confirmation) or not.
filteradd
message when adding the keypair in the wallet usingBitcoin::Wallet::Base#generate_new_address
or other API.