From d6282b845b09cd42f5c005099bf2231cbfdde438 Mon Sep 17 00:00:00 2001
From: Matthew Zipkin <pinheadmz@gmail.com>
Date: Thu, 4 Jun 2020 13:21:59 -0400
Subject: [PATCH] txdb: use covenant helper method isFinalize()

---
 lib/wallet/txdb.js | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/wallet/txdb.js b/lib/wallet/txdb.js
index 145c6cdce4..9acc396779 100644
--- a/lib/wallet/txdb.js
+++ b/lib/wallet/txdb.js
@@ -959,7 +959,7 @@ class TXDB {
         state.unconfirmed(path, -coin.value);
 
         // FINALIZE is a special case: locked coins _leave_ the wallet.
-        if (tx.output(i) && tx.covenant(i).type === types.FINALIZE) {
+        if (tx.output(i) && tx.covenant(i).isFinalize()) {
           if (!block)
             state.ulocked(path, -tx.outputs[i].value);
           else
@@ -1166,7 +1166,7 @@ class TXDB {
         state.confirmed(path, -coin.value);
 
         // FINALIZE is a special case: locked coins _leave_ the wallet.
-        if (tx.output(i) && tx.covenant(i).type === types.FINALIZE)
+        if (tx.output(i) && tx.covenant(i).isFinalize())
           state.clocked(path, -tx.outputs[i].value);
 
         await this.removeCredit(b, credit, path);
@@ -1314,7 +1314,7 @@ class TXDB {
 
         // FINALIZE is a special case: locked coins _leave_ the wallet.
         // In this case a TX is erased, adding them back.
-        if (tx.output(i) && tx.covenant(i).type === types.FINALIZE) {
+        if (tx.output(i) && tx.covenant(i).isFinalize()) {
           if (!block)
             state.ulocked(path, tx.outputs[i].value);
           else
@@ -1522,7 +1522,7 @@ class TXDB {
 
         // FINALIZE is a special case: locked coins _leave_ the wallet.
         // In this case a TX is reversed, adding them back.
-        if (tx.output(i) && tx.covenant(i).type === types.FINALIZE)
+        if (tx.output(i) && tx.covenant(i).isFinalize())
             state.clocked(path, tx.outputs[i].value);
 
         // Resave the credit and mark it