Commit graph

14 commits

Author SHA1 Message Date
Wilmer Paulino
0ae78b1f56
wtxmgr: only remove entry for specified spending transaction
In this commit, we address an issue with the wallet store where it'd be
possible for us to keep lingering unconfirmed transaction entries for an
output that has been spent by a different, confirmed transaction. This
was caused due to us removing all spending transaction entries for a
given output when removing conflicts. Since all of the entries would be
removed, we weren't able to retrieve the hashes of the remaining
spending transactions to remove their records as well. Instead, we
propose to only remove the entry for the specified spending transaction.
2019-03-22 16:59:04 -07:00
Wilmer Paulino
a0a5e46177
wtxmgr/db: add new createBuckets and deleteBuckets methods 2018-11-14 18:09:10 -08:00
Wilmer Paulino
c523ccd192
wtxmgr/db: remove LatestVersion const in favor of getLatestVersion
In this commit, we can remove the LatestVersion constant as it's no
longer needed. Instead, we'll now define the latest version as the last
entry in the slice of versions previously defined.
2018-11-05 17:58:16 -08:00
Wilmer Paulino
3bdfb6cc23
wtxmgr/db: define new helpers to set/get store version 2018-11-05 17:58:16 -08:00
Wilmer Paulino
aa826c64cf
wtxmgr: store multiple spending tx hashes for outpoints
In this commit, we modify the way we store spending transaction hashes
for unconfirmed spends. Now, rather than only keeping track of one
possible unconfirmed spend, we track multiple in order to ensure we
properly handle transaction replacements, like in the case of RBF,
double spends, etc. With this in, the double spent tests recently added
should now pass.
2018-07-16 13:39:53 -07:00
Olaoluwa Osuntokun
7770cac383 multi: switch import paths back to upstream 2018-05-23 19:38:56 -07:00
Olaoluwa Osuntokun
3dc7a8529c multi: switch all imports to roasbeef's forks 2018-05-23 19:38:56 -07:00
Josh Rickmar
2bb45752e1 fix wtxmgr tests
While making these tests compile and pass, we ended up tripping on the
broken bolt cursor usage painfully discovered in dcrwallet, so i've
ported that fix over as well.  Would have learned about that a whole
lot sooner if those tests were never disabled..
2018-05-23 19:38:56 -07:00
Josh Rickmar
4656a00705 Improve wallet atomicity.
This changes the database access APIs and each of the "manager"
packages (waddrmgr/wstakemgr) so that transactions are opened (only)
by the wallet package and the namespace buckets that each manager
expects to operate on are passed in as parameters.

This helps improve the atomicity situation as it means that many
calls to these APIs can be grouped together into a single
database transaction.

This change does not attempt to completely fix the "half-processed"
block problem.  Mined transactions are still added to the wallet
database under their own database transaction as this is how they are
notified by the consensus JSON-RPC server (as loose transactions,
without the rest of the block that contains them). It will make
updating to a fixed notification model significantly easier, as the
same "manager" APIs can still be used, but grouped into a single
atomic transaction.
2018-05-23 19:38:56 -07:00
Dave Collins
e92f94dcd1 Update for recent chainhash-related API changes. (#450)
This updates all code to make use of the new chainhash package since the
old wire.ShaHash type and related functions have been removed in favor
of the abstracted package.

Also, while here, rename all variables that included sha in their name
to include hash instead.

Finally, update glide.lock to use the required version of btcd, btcutil,
and btcrpcclient.
2016-08-08 14:49:09 -05:00
Josh Rickmar
5140086f6e Use LICENSE file and short license headers. 2016-02-28 22:22:34 -05:00
Josh Rickmar
4171638553 Fix several typos in documentation and comments. 2016-02-12 11:58:38 -05:00
Dave Collins
c820c8a015 Relicense to the btcsuite developers. 2015-05-01 12:20:05 -05:00
Josh Rickmar
0087d38710 Add wtxmgr package. 2015-04-25 00:42:28 -04:00