breadwallet / breadwallet-core

SPV bitcoin C library
MIT License
274 stars 324 forks source link

CORE-874: In `bwmHandleTxAdded()`, don't dereference `refedTransaction` #459

Closed EBGToo closed 4 years ago

EBGToo commented 4 years ago

[Draft, testing.]

EBGToo commented 4 years ago

Tried to reproduce... full sync, during sync send a transaction (w/ inputs that will be invalid), wait for sync to complete, stop app, start again, sync happens...

46.105.117.90:8333 removing tx unconfirmed at: 623990, txHash: 184221ceaf989c59d5f80e126dc13cd07e17bc5fe38e4d37869405bcc5be188a
SYS: Event: Wallet (btc): CRYPTO_WALLET_EVENT_BALANCE_UPDATED
APP: Wallet (btc:btc): BalanceUpdated
SYS: Event: Manager (btc): CRYPTO_WALLET_MANAGER_EVENT_WALLET_CHANGED
APP: Manager (btc): walletChanged(wallet: BRCrypto.Wallet)
APP: WVC: ManagerEvent: walletChanged(wallet: BRCrypto.Wallet)
SYS: Event: Wallet (btc): CRYPTO_WALLET_EVENT_TRANSFER_DELETED
SYS: Event: Transfer (btc @ 0x8a18bec5bc059486374d8ee35fbc177ed03cc16d120ef8d5599c98afce214218): CRYPTO_TRANSFER_EVENT_DELETED
APP: Wallet (btc:btc): TransferDeleted
APP: Transfer (btc:btc): deleted
SYS: Event: Manager (btc): CRYPTO_WALLET_MANAGER_EVENT_SYNC_RECOMMENDED
APP: WVC: TransferEvent: deleted
APP: Manager (btc): syncRecommended(depth: BRCrypto.WalletManagerSyncDepth.fromLastConfirmedSend)
APP: WVC: ManagerEvent: syncRecommended(depth: BRCrypto.WalletManagerSyncDepth.fromLastConfirmedSend)

worked fine.

EBGToo commented 4 years ago

I can't reproduce the crash.

I did reproduce the conditions where 'IsResovled' used refedTransaction instead of ownedTransaction and confirmed the change to ownedTransaction works.