Skip to content

Wallet::insert_tx should not have position input #1446

@evanlinjin

Description

@evanlinjin

Describe the problem

The Wallet::insert_tx method allows us to add a transaction and instantly confirm it by anchoring the transaction to the wallet tip. This is dangerous as the user is not aware of how it works internally, and may anchor the transaction to the wrong tip (which will result in nonsensical history later on).

The correct way to insert confirmed or in-mempool transactions is via a chain-source which creates a wallet::Update.

I propose changing this method to only insert transactions without anchors or last seen. Therefore, I think this will be tackled in #1416 (assuming that #1416 is a good idea). In other words, this method will just insert transactions that have not left "application memory", or unbroadcasted transactions.

Metadata

Metadata

Assignees

Labels

apiA breaking API changenew featureNew feature or request

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions