Last active
February 14, 2018 00:32
-
-
Save dnldd/2319c166d3cfbffcc6ee5a4d2492123d to your computer and use it in GitHub Desktop.
hasExpiry update
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Iterate through all unmined credits and update stored serializations | |
unminedCreditsBucket := txmgrBucket.NestedReadWriteBucket(bucketUnminedCredits) | |
unminedCursor := unminedCreditsBucket.ReadWriteCursor() | |
for k, v := unminedCursor.First(); v != nil; k, v = unminedCursor.Next() { | |
vCpy := make([]byte, len(v)) | |
copy(vCpy, v) | |
hash, err := chainhash.NewHash(extractRawUnminedCreditTxHash(k)) | |
if err != nil { | |
return err | |
} | |
recV := existsRawUnmined(txmgrBucket, hash[:]) | |
record := &TxRecord{} | |
err = readRawTxRecord(hash, recV, record) | |
if err != nil { | |
return err | |
} | |
// set the hasexpiry flag if the tx has an expiry value set | |
if record.MsgTx.Expiry != wire.NoExpiryValue { | |
vCpy[8] |= 1 << 4 | |
err = unminedCreditsBucket.Put(k, vCpy) | |
if err != nil { | |
return err | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment