[blockchain] Fix sent calculation in the RPC backend
We used to consider a tx input as ours if we had the tx that creates it in the database. This commit actually checks if an input is ours before adding its value to the `sent` field.
This commit is contained in:
@@ -257,7 +257,9 @@ impl Blockchain for RpcBlockchain {
|
||||
|
||||
for input in tx.input.iter() {
|
||||
if let Some(previous_output) = db.get_previous_output(&input.previous_output)? {
|
||||
sent += previous_output.value;
|
||||
if db.is_mine(&previous_output.script_pubkey)? {
|
||||
sent += previous_output.value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user