wtxmgr: separate PutTxLabel into store-independent function
Separate out the logic we use to write labels so that it can be used in dropwtxmgr to re-add labels if we want to keep them when we drop the rest of the db.
This commit is contained in:
parent
e0e62245ec
commit
4ec3fb4928
1 changed files with 9 additions and 0 deletions
|
@ -984,6 +984,15 @@ func (s *Store) PutTxLabel(ns walletdb.ReadWriteBucket, txid chainhash.Hash,
|
|||
return err
|
||||
}
|
||||
|
||||
return PutTxLabel(labelBucket, txid, label)
|
||||
}
|
||||
|
||||
// PutTxLabel writes a label for a tx to the bucket provided. Note that it does
|
||||
// not perform any validation on the label provided, or check whether there is
|
||||
// an existing label for the txid.
|
||||
func PutTxLabel(labelBucket walletdb.ReadWriteBucket, txid chainhash.Hash,
|
||||
label string) error {
|
||||
|
||||
// We expect the label length to be limited on creation, so we can
|
||||
// store the label's length as a uint16.
|
||||
labelLen := uint16(len(label))
|
||||
|
|
Loading…
Add table
Reference in a new issue